package com.lzq.rabbitmqdemo.amqp.listener;

import com.lzq.rabbitmqdemo.amqp.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkListener {

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void listenerQueue1(String message) {
        System.out.println("listener 1["+ Constants.WORK_QUEUE+"] 收到消息:" + message);
    }

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void listenerQueue2(String message) {
        System.out.println("listener 2["+ Constants.WORK_QUEUE+"] 收到消息:" + message);
    }

}
